An External Module for Implementing Linear Tabling in Prolog
نویسندگان
چکیده
In previous work [1], we have presented a proposal to combine the power of tabling with the Extended Andorra Model (EAM) in order to produce an execution model with advanced control strategies that guarantees termination, avoids looping, reduces the search space, and is less sensitive to goal ordering. To address the integration between tabling and the EAM, through the BEAM system [2], we have identified several tasks [1]. In particular, to study how tabling interacts with the BEAM, we proposed the ability to use an external module for implementing tabling primitives that provide direct control over the search strategy. This approach may compromise efficiency, if compared to systems that implement tabling support at the low-level engine, but allows tabling to be easily incorporated into any Prolog system. For our work, it will serve as the basis to study and detect in advance the potential integration problems before extending the BEAM system to support tabling running within the EAM environment. In the past years several alternative mechanisms for tabling have been proposed and implemented in systems like XSB, Yap, B-Prolog, ALS-Prolog and Mercury. In these implementations, we can distinguish two main categories of tabling mechanisms: delaying-based tabling mechanisms in the sense that the computation state of suspended tabled subgoal calls has to be preserved, either by freezing the whole stacks or by copying the execution stacks to separate storage; and linear tabling mechanisms where a new call always extends the latest one, therefore maintaining only a single SLD tree in the execution stacks. Delaying-based mechanisms can be considered more complicated to implement but obtain better results. The weakness of the linear mechanisms is the necessity of re-computation for computing fix-points. Implementing tabling through an external module restrict us to linear tabling mechanisms, because external modules cannot directly interact with the execution stacks. Therefore, we have decided to design a module that implements the two available mechanisms that, to the best of our knowledge, implement linear tabling: the SLDT strategy of Zhou et al. [3]; and the DRA technique of Guo and Gupta [4]. The key idea of the SLDT strategy is to let a tabled subgoal call
منابع مشابه
On Applying Program Transformation to Implement Suspension-Based Tabling in Prolog
A common approach used to include tabling support into existing Prolog systems is to modify and extend the low-level engine. Although this approach is ideal for run-time efficiency, it is not easily portable to other Prolog systems as engine level modifications are rather complex and time consuming. A different approach is to apply source level transformations to a tabled program and then use e...
متن کاملImplementation of a Linear Tabling Mechanism
Delaying-based tabling mechanisms, such as the one adopted in XSB, are nonlinear in the sense that the computation state of delayed calls has to be preserved. In this paper, we present the implementation of a linear tabling mechanism. The key idea is to let a call execute from the backtracking point of a former variant call if such a call exists. The linear tabling mechanism has the following a...
متن کاملMinimal Model Tabling in Mercury
Prolog systems such as XSB have proven that tabling can be quite helpful in a variety of tasks, especially if it is efficiently implemented and fully integrated in the language. Implementing tabling in Mercury poses special challenges for several reasons. First, Mercury is both semantically and culturally quite different from Prolog. While decreeing that tabled predicates must not include cuts ...
متن کاملMixed-Strategies for Linear Tabling in Prolog
Tabling is an implementation technique that solves some limitations of Prolog’s operational semantics in dealing with recursion and redundant sub-computations. Arguably, the SLDT and DRA strategies are the two most successful extensions to standard linear tabled evaluation. In this work, we propose a new strategy for linear tabling, named DRS, and we present a framework, on top of the Yap syste...
متن کاملAn Efficient Implementation of Linear Tabling Based on Dynamic Reordering of Alternatives
Tabling is a technique of resolution that overcomes some limitations of traditional Prolog systems in dealing with recursion and redundant sub-computations. We can distinguish two main categories of tabling mechanisms: suspension-based tabling and linear tabling. In suspension-based tabling, a tabled evaluation can be seen as a sequence of sub-computations that suspend and later resume. Linear ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2006